<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <style>
        * {
            margin: 0;  
            padding: 0;
        }
        #parent {
            width: 100px;
            height: 100px;
            background: red;
        }
        .none {
            display: none;
        }
        .show {
            display: block;
        }
    </style>
</head>

<body>
    <div id="parent" class="none"></div>
    <button id="toggle">toggle</button>
    <script>
        window.onload = function () {
            var toggle = document.getElementById("toggle");
            var parent = document.getElementById("parent");
            toggle.onclick = () => {

                if (parent.className == "none") {
                    parent.className = "show"
                } else {
                    parent.className = "none"
                }
            }
        }

    </script>
</body>

</html>